home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 1 / Gekikoh Dennoh Club Vol. 1 (Japan).7z / Gekikoh Dennoh Club Vol. 1 (Japan) (Track 1).bin / kowin / archive / apl / kocrtc10.lzh / kocrtc.c next >
Encoding:
C/C++ Source or Header  |  1995-06-15  |  1.0 KB  |  48 lines

  1. /*    1995 H.Ogasawara (COR.)        */
  2.  
  3. #include    <corlib.h>
  4. #include    <microfio.h>
  5. #include    <microstr.h>
  6.  
  7. unsigned short    scr[16];
  8.  
  9. WindowMain( argc, argv )
  10. char    **argv;
  11. {
  12.     int    get= FALSE;
  13.     char    buf[80];
  14.     m_file    fm;
  15.     if( argc >= 2 && argv[1][0] == '-' && argv[1][1] == 'g' ){
  16.         get= TRUE;
  17.         argc--;
  18.         argv++;
  19.     }
  20.     if( get && argc >= 2 && Mcreate( &fm, argv[1] ) ){
  21.         int    i;
  22.         for( i= 0 ; i< 8 ; i++ ){
  23.             int    j;
  24.             unsigned short    *s= WindowGetScreenTable( i );
  25.             s_format( buf, "# SCREEN-%d\r\n", i );
  26.             Mputs( &fm, buf );
  27.             for( j= 0 ; j< 16 ; j++, s++ ){
  28.                 s_format( buf, "%x\t(%d)\r\n", *s, *s );
  29.                 Mputs( &fm, buf );
  30.             }
  31.         }
  32.         Mflush( &fm );
  33.         Mclose( &fm );
  34.     }else if( argc >= 2 && Mopen( &fm, argv[1] ) ){
  35.         int    i;
  36.         for( i= 0 ; i< 8 ; i++ ){
  37.             int    j;
  38.             unsigned short    *s= WindowGetScreenTable( i );
  39.             for( j= 0 ; j< 16 ; j++ ){
  40.                 do Mgets( &fm, buf, 80 ); while( *buf == '#' );
  41.                 *s++= n_hexstr( buf );
  42.             }
  43.         }
  44.         Mclose( &fm );
  45.     }
  46.     WindowSendSignal( WindowProcessID, SignalKill, 0 );
  47. }
  48.